import { NODE_TYPE } from '@/constants/config';
import { BaseNode } from '../../BaseNode';
import { baseNodeProps, defineComponentAndRegisterToGraph } from '../../BaseNode/define';
import { NodeDrawer } from '../../NodeDrawer';
import { NodeVariableMangerForm } from '../../NodeVariableMangerForm';

export const BatchNode = defineComponentAndRegisterToGraph({
  name: NODE_TYPE.BRANCH,
  props: {
    ...baseNodeProps
  },
  setup(props) {
    return () => {
      return (
        <NodeDrawer>
          {{
            reference: (baseProps: any) => {
              return <BaseNode {...props} {...baseProps} nodeType={NODE_TYPE.BRANCH} />;
            },
            default() {
              return (
                <div>
                  <NodeVariableMangerForm />
                </div>
              );
            }
          }}
        </NodeDrawer>
      );
    };
  }
});
